﻿<%@ Page Language="C#" MasterPageFile="~/GUIMaster.Master" AutoEventWireup="true" CodeBehind="acceptPassenger.aspx.cs" Inherits="TripLOA.GUI.secure.acceptPassenger" Title="Trip LOA" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<%@ Register Assembly="MapControl2" Namespace="MapControl2" TagPrefix="map" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHomePage" runat="server">
    <h1>TripLOA</h1>
 <h2>
     <asp:Label ID="lblException" runat="server" 
        Visible ="False" 
         meta:resourcekey="lblExceptionResource1"></asp:Label>
 </h2>
  <div id="TextConfirm" style="width:700px;text-align:center;">
    <asp:UpdatePanel ID="UpdatePanelOK" UpdateMode="Conditional" runat="server" Visible="false">
    <ContentTemplate>

        <asp:Label ID="lblOK" runat="server" Text="Il passeggero è stato accettato!" meta:resourcekey="lblOKRes" Visible="true" Font-Bold="True" Font-Size="Larger" ForeColor="#D1FB2D"></asp:Label>
        <br />
        <br />
        <br />
        <asp:Button ID="btnRedirect"  CssClass="button_generics" runat="server" Text="Button" OnClick="RedirectOtherPage" meta:resourcekey="btnRedirectRes" Height="50px" Width="100px" Visible="true" />
        <br />
        <br />
        <br />
        <br />
    </ContentTemplate>
    </asp:UpdatePanel>
    </div>
<div id="map_header_detail"></div>
        <div id="map_line_detail">
            <div id="Map" style="width:700px; height:500px; margin-left: 28px;"> </div></div>
        <div id="map_footer_detail"></div>
<map:LOAMap ID="map_1" runat="server" MapDiv="Map" ZoomLevel="10" Editable="true" 
        meta:resourcekey="map_1Resource1" />
        <script type="text/javascript">
                        mapStrings["add_destination"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuAddDest") %>';
                        mapStrings["remove_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuRemTrip") %>';
                        mapStrings["select_vehicle"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuSelVehicle") %>';
                        mapStrings["insert_waypoint"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuInsWay") %>';
                        mapStrings["take_in_passenger"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuTakeInPass") %>';
                        mapStrings["take_off_passenger"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuTakeOffPass") %>';
                        mapStrings["detach_passenger"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuDetachPass") %>';
                        mapStrings["detach_from_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoMenuDetachTrip") %>';
                        mapStrings["passengers_in"]  ='<%= this.GetGlobalResourceObject("TripLoaResource","GeoPassIn") %>';
                        mapStrings["passengers_off"] ='<%= this.GetGlobalResourceObject("TripLoaResource","GeoPassOff") %>';
                        
                        mapStrings["start_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeosInfoRoute") %>';
                        mapStrings["startDescr_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeosDescrInfoRoute") %>';
                        mapStrings["end_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoeInfoRoute") %>';
                        mapStrings["endDescr_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoeDescrInfoRoute") %>';
                        mapStrings["dist_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoDistInfoRoute") %>';
                        mapStrings["time_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoTimeInfoRoute") %>';
                        mapStrings["wayNumb_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeonWayInfoRoute") %>';
                        mapStrings["title_info_route"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoTitleInfoRoute") %>';
                        
                        mapStrings["start_info_trip"]='<%=this.GetGlobalResourceObject("TripLoaResource","GeosInfoTrip") %>';
                        mapStrings["startDescr_info_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeosDescrInfoTrip") %>';
                        mapStrings["end_info_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoeInfoTrip") %>';
                        mapStrings["endDescr_info_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoeDescrInfoTrip") %>';
                        mapStrings["dist_info_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoDistInfoTrip") %>';
                        mapStrings["time_info_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoTimeInfoTrip") %>';
                        mapStrings["routeN_info_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeonRoutesInfoTrip") %>';
                        mapStrings["title_info_trip"]='<%= this.GetGlobalResourceObject("TripLoaResource","GeoTitleInfoTrip") %>';
                        
                        mapStrings["endLabel_trip"]='<%=this.GetGlobalResourceObject("TripLoaResource","GeoEndLabel") %>';
                        mapStrings["end_trip"]='<%=this.GetGlobalResourceObject("TripLoaResource","GeoEndTrip") %>';
                        mapStrings["endDescr_trip"]='<%=this.GetGlobalResourceObject("TripLoaResource","GeoEndDescr") %>';

                        mapStrings["waypointLabel"]= '<%=this.GetGlobalResourceObject("TripLoaResource","GeoWayLabel") %>';
                        mapStrings["waypoint_Location"]='<%=this.GetGlobalResourceObject("TripLoaResource","GeoWayLoc") %>';
                        mapStrings["waypoint_Descr"]='<%=this.GetGlobalResourceObject("TripLoaResource","GeoWayDescr") %>';
                        
                        mapStrings["passengers_in"]  ='<%= this.GetGlobalResourceObject("TripLoaResource","GeoPassIn") %>';
                        mapStrings["passengers_off"] ='<%= this.GetGlobalResourceObject("TripLoaResource","GeoPassOff") %>';
        </script>
<br />
<br />
    <div id="buttons" style="text-align:center; width:700px">
    <asp:Button ID="btnAccept"  CssClass="button_generics" runat="server" Text="Accept" UseSubmitBehavior="false"
        onclick="btnAccept_Click" TargetControlIDs="ctl00_ContentHomePage_btnAccept" 
            Height="50px" Width="100px" meta:resourcekey="btnAcceptResource1" />
    <asp:Button ID="btnCancel" CssClass="button_generics" runat="server" Text="Cancel" Height="50px" Width="100px"
        onclick="btnCancel_Click" meta:resourcekey="btnCancelResource1" />
    </div>
    <div id="status" style="text-align:center">
        <label id="lbl_status" style="visibility:hidden; color:Yellow" meta:resourcekey="msg_error">Passenger is not attached to the trip!</label>
    </div>
    
    <script type="text/javascript">
        Sys.Application.add_load(initialize);
        function initialize(){
            var btnAccept = $get('ctl00_ContentHomePage_btnAccept');
            var oldHandler = btnAccept.onclick;
            btnAccept.onclick = function(e){
                var map = Sys.Application.findComponent('ctl00_ContentHomePage_map_1');    
                var lblstatus = $get('lbl_status');
                if (map.getGMap().isPassengerAttached())
                    oldHandler(e);
                else{
                    lblstatus.style.visibility = 'visible';
                    setTimeout(function(){lblstatus.style.visibility='hidden';}, 3000);
                }
            }
        }
    </script>
</asp:Content>
